const Router = require('koa-router');
const {db, Op,QueryTypes } = require("../../models/db");
const router = new Router();
// 改变购物车数量
router.post('/zd/changeCart', async ctx => {
    let usr = ctx.user
    let tenantId = usr.tenantId
    let cart = ctx.request.body.cart
    let cartModel = await db.models['cartZd'].findOne({
        where: {
            tenantId,
            buId: usr.buId,
            invId: cart.invId,
            unit: cart.unit,
        }
    })
    cartModel.qty = cart.qty
    await cartModel.save()
    return ctx.suc('')
})

module.exports = router;
